<?php

class Workset_Validate_MimeType2 extends Zend_Validate_File_MimeType {

    function __construct($mimetype) {

        if ($mimetype instanceof Zend_Config) {
            $mimetype = $mimetype->toArray();
        } elseif (is_string($mimetype)) {
            $mimetype = explode(',', $mimetype);
        }

        if (!$this->_detect()) {
            if (isset($mimetype['magicfile'])) {
                unset($mimetype['magicfile']);
            }
        }

        parent::__construct($mimetype);
    }


    function isValid($value) {

        if ($this->_detect()) {
            return parent::isValid($value);
        } else {
            return true;
        }

    }

    protected function _detect() {
        return false === strpos(PHP_OS, 'WIN');
    }

}



?>